<!--- use in displaying the update until, view until, and cutoff dates --->
<script type="text/javascript">
	function ShowLine(tid) {
		pos = document.getElementById(tid);
		pos.style.visibility = "Visible";
	}
	function HideLine(tid) {
		pos = document.getElementById(tid);
		pos.style.visibility = "Hidden";
	}
</script>



<CFSET session.tabId = "dtr">
<!---<CFSET session.tabLocation = "../../eDTR">--->
<cfset client.common_path = "../common/" />
<CFINCLUDE TEMPLATE="#client.common_path#_toggle.cfm">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<TITLE>iBOS/e eDTR</TITLE>
		<CFOUTPUT>
			<LINK REL="StyleSheet" HREF="#client.wstheme_path##client.empcolor#.css" TYPE="text/css">
		</CFOUTPUT>
		<!--- use in displaying the update until, view until, and cutoff dates --->
		<style type="text/css">			
		  .hoverline {
			visibility:hidden; 
			position:inherit;
			top:0; 
			left:0;
		  }
		</style>

		
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">	
function openMaster(sID,PID) {
		window.open("./edtrmain/index.cfm?id=" +sID +"&pid=" +PID,
					"MASTER","<!---width=700,height=530,--->fullscreen = yes,ScrollBars=Yes,Resizable=Yes");
	}
</SCRIPT>
	</HEAD>
	<CFSET webCompCode = "dtr">
	<cfset masterview = "">
	<CFMODULE TEMPLATE = "#client.common_path#cfm_checkuserrecords.cfm" USERTABLE = "ECRTDTR"
		USERFIELD = "USERGRPID_FK" RECORDFIELD = "EDTRCODE_FK" RECORDID = "master" BOOLEANFIELDS="ISVIEW">
	<cfset masterview = fieldisview>
	<CFMODULE TEMPLATE = "#client.common_path#cfm_checkuserrecords.cfm" USERTABLE = "ECRTDTR"
		USERFIELD = "USERGRPID_FK" RECORDFIELD = "EDTRCODE_FK" BOOLEANFIELDS="ISVIEW">

<cfif masterview neq "Y">

	<CFQUERY NAME = "QRYECRGDTR" DATASOURCE = "#CLIENT.COMPANY_DSN#">
		SELECT EDTRCODE, EDTRGROUP, EDTRDESC, SHAREDVIEW, SHAREDUPDATE, VIEWUNTIL, UPDATEUNTIL, GROUPCODE, CUTOFF	
			   FROM ECRGDTR
		WHERE #SQLUPPERCASE#(EDTRCODE) <> <CFQUERYPARAM VALUE = "MASTER" CFSQLTYPE = "CF_SQL_VARCHAR"> AND
		      #SQLUPPERCASE#(SHAREDVIEW) = <CFQUERYPARAM VALUE = "YES" CFSQLTYPE = "CF_SQL_VARCHAR"> AND	   
		      VIEWUNTIL >= <CFQUERYPARAM VALUE = "#DATEFORMAT(NOW(), "MM/DD/YYYY")#" CFSQLTYPE = "CF_SQL_TIMESTAMP"> AND
              EDTRCODE IN (<CFQUERYPARAM VALUE = "#USERRECORDS#" LIST = "YES" CFSQLTYPE = "CF_SQL_VARCHAR">)			  
		ORDER BY EDTRGROUP, EDTRDESC
	</CFQUERY>
	<!---end--->
	
<cfelse>

	<CFQUERY NAME = "qryECRGDTR" datasource="#CLIENT.COMPANY_DSN#">
		SELECT EDTRCODE, EDTRGROUP, EDTRDESC, SHAREDVIEW, SHAREDUPDATE, VIEWUNTIL, UPDATEUNTIL, GROUPCODE, CUTOFF
		       FROM ECRGDTR
		WHERE #SQLUPPERCASE#(EDTRCODE) <> <CFQUERYPARAM VALUE = "MASTER" CFSQLTYPE = "CF_SQL_VARCHAR"> AND
		      #SQLUPPERCASE#(SHAREDVIEW) = <CFQUERYPARAM VALUE = "YES" CFSQLTYPE = "CF_SQL_VARCHAR"> AND
			  VIEWUNTIL >= <CFQUERYPARAM VALUE = "#DATEFORMAT(NOW(), "MM/DD/YYYY")#" CFSQLTYPE = "CF_SQL_TIMESTAMP">
		ORDER BY EDTRGROUP, EDTRDESC
	</CFQUERY>
	
</cfif>
	<BODY LEFTMARGIN=0 RIGHTMARGIN=0 TOPMARGIN=0 BOTTOMMARGIN=0>
	<CFMODULE TEMPLATE="#client.common_path#cfm_workspace.cfm" MODULE="#webCompCode#">
		<CFOUTPUT>
			<TABLE BORDER=0 CELLSPACING=5 CELLPADDING=0 WIDTH="100%">
				<CFIF isdefined("session.sMess") and session.sMess NEQ "">
					<TR>
						<TD>
							<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="Information">
							<BR><B>#session.sMess#</B><BR>
							<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
							<cfset session.sMess="">
						</TD>
					</TR>
				</CFIF>
				<TR VALIGN="top">
					<TD WIDTH="60%">
						<CFINCLUDE TEMPLATE="./main.cfm">
					</TD>
					<TD>
						<!--- display the utilities --->
						<CFMODULE TEMPLATE="#client.common_path#cfm_utilities.cfm" MODULE="dtr">
					</TD>
				</TR>
			</TABLE>
		</CFOUTPUT>
		<CFMODULE TEMPLATE="#client.common_path#cfm_workspace.cfm" TOP="False">
	</BODY>
</HTML>